UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '1SGSWKOuJ6BvSF1Hpsju4M7VbDbS1DURSa8OiMEGhuE='
WHERE
key_id = '14e01d59fa9455f236f06d1efb6eb93e2248675751a40a61c9b0fc2a79e60d2a'
AND (
token = '1SGSWKOuJ6BvSF1Hpsju4M7VbDbS1DURSa8OiMEGhuE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)