UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6JOSbtQ40HOxteITkJbUDWUZ/nkXpgW3+MnqXYFND2M='
WHERE
key_id = 'ce8b3ba5decc53f1cca5465e17e66bca8e73b35f1d39ac4ae049a528e87a0f31'
AND (
token = '6JOSbtQ40HOxteITkJbUDWUZ/nkXpgW3+MnqXYFND2M='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)