UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/tcWSn24QRgNJmWm4UNfi8eLDKxPz+XwOCFjpR3q7M8='
WHERE
key_id = '61bf388f4a845494dab1ba3ba438eae1524a4c135d4888e2fa39244192922a4c'
AND (
token = '/tcWSn24QRgNJmWm4UNfi8eLDKxPz+XwOCFjpR3q7M8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)