UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'K3/BTLEqATSNXIFLJSd6/MJNFOBfRpZO5FFtgPrv86o='
WHERE
key_id = 'f93c23eef23b74353df2d7c868783b6afc9bd1b0dbe9b72184d7f1ba5b5402a3'
AND (
token = 'K3/BTLEqATSNXIFLJSd6/MJNFOBfRpZO5FFtgPrv86o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)