UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '7JFhsHFwIZButMEJizkynwDrhV1T9J9dgFwzgSg09HE='
WHERE
key_id = 'ae3924a2fd4182d6e068d34820edc6e662a4d4c951fb0bfb063bce5f4c6286b5'
AND (
token = '7JFhsHFwIZButMEJizkynwDrhV1T9J9dgFwzgSg09HE='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)