UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'ItgZw85ryJ327Zz5EkNbs0mtFVj/JY4lSX97x9KYiYo=' 
WHERE 
  key_id = '08a8c5285833b58054b35c612d61f4b78e172828e12fe7229fe27978185dc4ab' 
  AND (
    token = 'ItgZw85ryJ327Zz5EkNbs0mtFVj/JY4lSX97x9KYiYo=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00029