UPDATE
cscart_lock_keys
SET
expiry_at = UNIX_TIMESTAMP(NOW()) + 30,
token = '6ADvnqPe30GiD41uzbD7J3ZYn0ZLylIJ8yQy8Px9W5c='
WHERE
key_id = '98df6cb48ceec13cb8567f68923b2b2d47c8c4b2869fb097d02978f60ca8a5d5'
AND (
token = '6ADvnqPe30GiD41uzbD7J3ZYn0ZLylIJ8yQy8Px9W5c='
OR expiry_at <= UNIX_TIMESTAMP(NOW())
)