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