UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'SwK6FRQyqfilRoUMRWqsLr5vBaNF5iPurDO0EgMfl/o='
WHERE
key_id = '813e708db71a27184f28a77beb108052f318544fffc1ffd4530f9f5420afeb50'
AND (
token = 'SwK6FRQyqfilRoUMRWqsLr5vBaNF5iPurDO0EgMfl/o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)