UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'q52OD/EucE6Pp9Fgn9kgoOylehvXPXWf2ohYS0ODBu8='
WHERE
key_id = '71dd5ac18bb6b052ed0b7d9d7a1eba9fd933e9b5dcd6d60cea4af2675b91aeab'
AND (
token = 'q52OD/EucE6Pp9Fgn9kgoOylehvXPXWf2ohYS0ODBu8='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)