UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '/epiGuBgY4yLu17QF1rDwDfyw3fqTPfAiRbBEH8e/M0='
WHERE
key_id = '7813719514c8af014a87df23bd2e1b13532838b0adec529f0246e736d70683a7'
AND (
token = '/epiGuBgY4yLu17QF1rDwDfyw3fqTPfAiRbBEH8e/M0='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)