UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'XEKxoizuNppn1fUhD8AZbes4kv3Sd9rLbU8T362MMKQ='
WHERE
key_id = 'd6f299d37670ddcb2dc1407c961262235aa516416ca8ebf142fea635af374ace'
AND (
token = 'XEKxoizuNppn1fUhD8AZbes4kv3Sd9rLbU8T362MMKQ='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)