UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'WAlA/6PD/PWnR564HhidJC7qadlWUEf1gJ9BcIuqnRI='
WHERE
key_id = '7b8d592cb09f3e6bd7fd80c7e683aa18a2d29b13d61b6686cc70e7fd4a8bc129'
AND (
token = 'WAlA/6PD/PWnR564HhidJC7qadlWUEf1gJ9BcIuqnRI='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)