UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'Za0Ib82R/rz1sS81/lICSNIa1PehF6FFVgqqd5z6FSE='
WHERE
key_id = 'cd55c625cb0a6fad86b31244d20333067a237717c7e6c3ffd0fa5ded8e04e89b'
AND (
token = 'Za0Ib82R/rz1sS81/lICSNIa1PehF6FFVgqqd5z6FSE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)