UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'TWgSz1SntjqRJI3j9iC1OX7W7VPlk2F8wFGJvu1deSs='
WHERE
key_id = '337dd4ef58cc7dbc1f5d6671ffc787bdedf054fbc3cc873e6740f19254cb9b7c'
AND (
token = 'TWgSz1SntjqRJI3j9iC1OX7W7VPlk2F8wFGJvu1deSs='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)