UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Dfhmu43DXkpowntWIjXfA7XqjnNTf28cT692Q6xfiIQ='
WHERE
key_id = '8d92a7cc40095224d7c842dab942812fb0f83805e279c17d9cb79910bf90ed0f'
AND (
token = 'Dfhmu43DXkpowntWIjXfA7XqjnNTf28cT692Q6xfiIQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)