UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = 'E00Fav1CVeDtG4Iyiug8oaG92+k33NY33IMFNzJgKQs=' 
WHERE 
  key_id = '6c48ebde7c8c7ab91ed54637858029d0e8a1a14832b93ccc96dadbc5cb65b55b' 
  AND (
    token = 'E00Fav1CVeDtG4Iyiug8oaG92+k33NY33IMFNzJgKQs=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00031