UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '63iLJcVlKoIl6SewY1kIKPPrn7rsxTurgsZX05f1y0w='
WHERE
key_id = '8817ba74bdc88ab6028535f87f9c95af5d4a242d4c5c126d0d4434ff3e2dfa5b'
AND (
token = '63iLJcVlKoIl6SewY1kIKPPrn7rsxTurgsZX05f1y0w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)