UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'k5WTC0JipTfvz7Ijpa0TJELrkHINSIO5DRsl53yEH5o='
WHERE
key_id = '69eb72507c1ca87c5969956b1854014e06e30cd2c1b2db0abe44548537e31b92'
AND (
token = 'k5WTC0JipTfvz7Ijpa0TJELrkHINSIO5DRsl53yEH5o='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)