UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'N141w5zM29VIKpRKrQbie9VNc8Vk6Xqy7B4BiA9+JEE=' 
WHERE 
  key_id = '01b2f09c331d78effd8ad8d0a33d818510e70065813fa80091cd38ef03a2f6f9' 
  AND (
    token = 'N141w5zM29VIKpRKrQbie9VNc8Vk6Xqy7B4BiA9+JEE=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00023