UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'sruDAvluqnaTBjvpHMVOcecJ5JKQ6sOfZ7ylXxt2Ylk='
WHERE
key_id = 'f319cd723450e331d888e13a1431e88887814b858fc3935ccb44999f6dcc69e8'
AND (
token = 'sruDAvluqnaTBjvpHMVOcecJ5JKQ6sOfZ7ylXxt2Ylk='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)