UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '+IFtTz/hFzLeIjWEy5A2wxtWG5UiFAOIqZcHGizbAVA=' 
WHERE 
  key_id = '76ce8249a798d60ad331d8ae27a8f683baab240008ec0fd41418f39beb3ee050' 
  AND (
    token = '+IFtTz/hFzLeIjWEy5A2wxtWG5UiFAOIqZcHGizbAVA=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00088