UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '2MZlnKjvDMZP44cM8az6gIGATZOE1Y/IVWGTC9VWnUQ='
WHERE
key_id = 'fb63853df21ab4a11c66c2b5c89c009f8f74a318516e957f9f20adeebabc0ea1'
AND (
token = '2MZlnKjvDMZP44cM8az6gIGATZOE1Y/IVWGTC9VWnUQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)