UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'D6FFmQs4L/usyEGab17dF5BWJuSNmGCEVHyfrJ1cHFw='
WHERE
key_id = 'fec05dce564ac504c4d5bfbfb6b0ffc18f53388630a0a3dd4db5c77ea5c97f57'
AND (
token = 'D6FFmQs4L/usyEGab17dF5BWJuSNmGCEVHyfrJ1cHFw='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)