UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7qEQ/OMfCrJis2rBVRUZSCoSRgrvbDo1QUymLRSoMTk='
WHERE
key_id = 'b01c60a5023f44b10726f114fbabb4a9c47afa21c566705ae836c33692e6b175'
AND (
token = '7qEQ/OMfCrJis2rBVRUZSCoSRgrvbDo1QUymLRSoMTk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)