UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K8Q8ovLTGS+CAucrLDWMfpCxhQPV8lE6vf3sTjP4ibQ='
WHERE
key_id = '4bb66d044a65fa63437c700ea858faceae798fecbfc2e99c70a8751c13a84aa9'
AND (
token = 'K8Q8ovLTGS+CAucrLDWMfpCxhQPV8lE6vf3sTjP4ibQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)