UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'OpoMganNnGpWuJw5ZfjTvD1eb10rbmLoLhxs++cEZqY='
WHERE
key_id = 'f9e3af5aebdb1be54218621efa5a905220aa555d7348580bba731e6674c26065'
AND (
token = 'OpoMganNnGpWuJw5ZfjTvD1eb10rbmLoLhxs++cEZqY='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)