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