UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Xe3EFPr7ArCXqYmDbOOyOttWdHS2tzP2Z7S5lamnVUk='
WHERE
key_id = 'faecd7ef357eff02e864c566989bce8410ad922fe2233438c0dbec9197a01b8a'
AND (
token = 'Xe3EFPr7ArCXqYmDbOOyOttWdHS2tzP2Z7S5lamnVUk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)