UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '0T57LtttVYSr5fkqJNSpdX5WyS3F51/4O3tfUZCsDhY=' 
WHERE 
  key_id = '6c42980bbb5b691ab5726a3beca3a611d82f5aebea8b9237fff25496b6ae04ed' 
  AND (
    token = '0T57LtttVYSr5fkqJNSpdX5WyS3F51/4O3tfUZCsDhY=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00032