UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'HT1eMcZnu/6LdvfLsBIoKQPeUNKrXcxipjLS9XTPq7w='
WHERE
key_id = '98bdc8440ae09cc7b3600a9c7b52f9bbe5133f70c50f6ee6341197897f22e9df'
AND (
token = 'HT1eMcZnu/6LdvfLsBIoKQPeUNKrXcxipjLS9XTPq7w='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)