UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'B15OegHw86M/NaswfgcNsekSQh/Vw6P4zEKTIsXQMTU='
WHERE
key_id = '3715014577e6b015b07720442876b4787390eeb6b6c9cc830a04758d9f5b92d3'
AND (
token = 'B15OegHw86M/NaswfgcNsekSQh/Vw6P4zEKTIsXQMTU='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)