UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = 'FU5cDrZoDfE9SABnXp6AOE2sr/6AmboL8SFqRxxRdBo='
WHERE
key_id = 'ce44b4c1335ff4b26a03452504953d81c27932f381836ce717c0e4843e9b1da5'
AND (
token = 'FU5cDrZoDfE9SABnXp6AOE2sr/6AmboL8SFqRxxRdBo='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)