UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'jGWdlBDyfEzxcANt0E+kYXTAW63xr61zlJmYhfdwwzQ='
WHERE
key_id = 'a203a9b0fa0e6421fd6257a88d0e5e25e4dc1e18120896bf395d5c139428b232'
AND (
token = 'jGWdlBDyfEzxcANt0E+kYXTAW63xr61zlJmYhfdwwzQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)