UPDATE 
  cscart_lock_keys 
SET 
  expiry_at = UNIX_TIMESTAMP(NOW()) + 30, 
  token = '2u073i4pKt6abmNZC329ebg/4OCdHNbCrAVPi7vjEpk=' 
WHERE 
  key_id = 'c11f326a781cfe91f490fe49f950b57f2ec0114706949777af888768b33abb49' 
  AND (
    token = '2u073i4pKt6abmNZC329ebg/4OCdHNbCrAVPi7vjEpk=' 
    OR expiry_at <= UNIX_TIMESTAMP(NOW())
  )

Query time 0.00026