UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'W/WAysfCjDzAgMmnxxiYY3MjFOXLORppiuIQfQvsxac='
WHERE
key_id = '53a8f805cf5f446543560677a79e17dfb22d3133f88f6e98e534b4d7f281669e'
AND (
token = 'W/WAysfCjDzAgMmnxxiYY3MjFOXLORppiuIQfQvsxac='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)